package com.tf_cut.backend.datadic.service;

import com.tf_cut.backend.common.service.CommonServiceImpl;
import com.tf_cut.backend.datadic.pojo.DataDic;
import com.tf_cut.backend.datadic.vo.DatadicVo;
import com.tf_cut.backend.mapper.DatadicMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

@Service
public class DatadicServiceImpl extends CommonServiceImpl<DatadicVo, DataDic,Long> implements IDatadicService {

    @PersistenceContext
    private EntityManager em;
    @Autowired
    private DatadicMapper datadicMapper;

    @Override
    public List<DatadicVo> qryDatadicByCode(String code) {
        DatadicVo datadicVo = new DatadicVo();
        datadicVo.setDatadicCode(code);
        return datadicMapper.queryDatadicByCode(datadicVo);
    }

    @Override
    public int updateDatadic(DatadicVo datadicVo) {
        return datadicMapper.updateDatadic(datadicVo);
    }
}
